home *** CD-ROM | disk | FTP | other *** search
- /*
- IC Specific Override.h
-
- Header file for IC Specific Override.c
-
- */
-
- #pragma once
-
- #ifndef __H_IC_Specific_Override__
- #define __H_IC_Specific_Override__
-
- #define kOurComponentManufacturer 'JMJ '
- // You must set this up appropriately. Things will not be good otherwise.
-
- #define delegateThisCallErr 0x81234568
- // Return this from a component routine if you want the generic override
- // component to pass this call through to the captured component.
-
- #define kRandomSigFoldName 130
- #define kDefaultSignature 128
-
- struct SharedGlobalsStruct {
- Component delegate;
-
- // add your own shared globals here
-
- };
-
- typedef struct SharedGlobalsStruct SharedGlobals,* SharedGlobalsPtr;
-
- struct GlobalsRecordStruct {
- ComponentInstance self;
- ComponentInstance target;
- ComponentInstance delegate;
- SharedGlobalsPtr shared;
-
- // add your own component specific globals here
-
- Handle current_signature;
- Handle default_signature;
- Str63 sig_folder_name;
- long random_seed;
- };
-
- typedef struct GlobalsRecordStruct GlobalsRecord,* GlobalsPtr,** GlobalsHandle;
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- // Except when otherwise noted the globals handle is locked when any of these routines are called.
-
- pascal ComponentResult ICSOInitShared(GlobalsHandle globals);
- // This routine is called to init the shared globals. If you return an error then you should make
- // sure your part ofthe shared globals are 'clean'.
-
- pascal ComponentResult ICSOCleanShared(GlobalsHandle globals);
- // This routine is called to clean the shared globals.
- // WARNING: This will never been called if you're using an old version of the Component Manager.
- // Workaround: If your specifics only bleeds small amounts of memory then don't worry. If your
- // specifics bleeds a lot of memory or other resources (such as open files) then refuse to install
- // with older Component Managers (I think it was fixed in v2 of the manager).
-
- pascal ComponentResult ICSOInitGlobals(GlobalsHandle globals);
- // This routine inits the override specific fields of the component specific globals. If it returns an
- // error then the globals must be 'clean'.
-
- pascal ComponentResult ICSOCleanGlobals(GlobalsHandle globals);
- // This routine cleans up the component specific globals, disposing any pointers and otherwise
- // releasing any allocated resources.
-
- pascal ComponentResult ICSOCanDo(GlobalsHandle globals,short selector);
- // This routine is called in response to a component can do request. You should set component result to:
- // -1 if you definitely want to say that the component can't do this
- // 0 if you definitely want to say that the component can do this
- // 1 if you want to let the target decide
- // WARNING: These constants are quite different from the constants used by a standard
- // Component Manager CanDo request.
-
- pascal ComponentFunctionUPP ICSOWhatToOverride(GlobalsHandle globals,short selector);
- // Return nil if you do not want to override this what. Return a pointer to a procedure with the
- // appropriate signature if you do.
- // WARNING: globals will not necessarily be locked and may be nil!!!
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif /* __H_IC_Specific_Override__ */
-